package org.springframework.samples.mvc.basic.tipProizvodenPogon;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.samples.mvc.basic.business.AbstractBusinessService;
import org.springframework.samples.mvc.basic.business.Transformer;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.proba.annotations.GenericDAO;
import com.proba.annotations.TipProizvodenPogonDAO;
import com.proba.annotations.pojo.TipProizvodenPogon;

@Service
public class TipProizvodenPogonBusinessServiceImpl extends AbstractBusinessService<TipProizvodenPogon, TipProizvodenPogonView> implements TipProizvodenPogonBusinessService {

	@Autowired
	private TipProizvodenPogonDAO dao;
	private TipProizvodenPogonTransformer transformer = new TipProizvodenPogonTransformer();

	@Override
	@Transactional
	public List<TipProizvodenPogonView> findAll(int startIndex, int pageSize,
			TipProizvodenPogonView queryInfo) {
		return transform(dao.findByFilterParams(startIndex, pageSize, queryInfo.getId(), queryInfo.getTipProizvodenPogon()));
	}

	@Override
	protected GenericDAO<TipProizvodenPogon, Long> getDao() {
		return dao;
	}

	@Override
	protected Transformer<TipProizvodenPogon, TipProizvodenPogonView> getTransformer() {
		return transformer ;
	}

}
